package com.zhuangjie.mvc.injector;

import com.zhuangjie.mvc.injector.porter.InjectPorter;

import java.util.List;

/**
 * 搬运工管理
 *
 * @author zhuangjie
 * @date 2024/06/14
 */
public class PorterManage<P extends InjectPorter> {
    private P injectPorter;
    public PorterManage(Class<P> injectPorterClass) {
        try {
            this.injectPorter = injectPorterClass.newInstance();
        } catch (Exception e) {
            throw new RuntimeException("PorterManage class：injectPorterClass create instance failed！"+e.getMessage());
        }
    }

    public<T> Horn<T,P> injectTo(List<T> tList) {
        // tList -> Map -> Porter
        // 在此注入Porter需要的数据，根据注解。

        return new Horn<>(injectPorter);
    }
}
